/*
 *    Copyright (c) 2018-2025, proj All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the proj developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: proj
 */

package com.ykht.proj.coupon.controller.b;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ykht.proj.common.core.util.R;
import com.ykht.proj.coupon.service.FxBrandPersonService;
import com.ykht.proj.coupon.service.FxWaiterExtService;
import com.ykht.proj.coupon.vo.FxBrandPersonVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;


/**
 * 品牌和c端关联表（饭友表）
 *
 * @author proj code generator
 * @date 2021-02-01 19:00:43
 */
@RestController
@AllArgsConstructor
@RequestMapping("b/fxbrandperson")
@Api(value = "b/fxbrandperson", tags = "品牌和c端关联表（饭友表）管理")
@Slf4j
public class BxBrandPersonController {

	private final FxBrandPersonService fxBrandPersonService;
	/**
	 * 服务员 服务
	 */
	private final FxWaiterExtService fxWaiterExtService;

	/**
	 * 获取B端 饭友团队
	 *
	 * @param page
	 * @param fxBrandPersonVo
	 * @return
	 */
	@ApiOperation(value = "获取B端 饭友团队", notes = "饭友详情的 饭友列表 分页")
	@GetMapping("/getFanYouTeamListPage")
	public R<IPage<FxBrandPersonVo>> getFanYouTeamListPage(Page page, FxBrandPersonVo fxBrandPersonVo) {
		fxBrandPersonVo.setWaiterIdList(fxWaiterExtService.getWaiterIdList());
		log.info("->获取B端 饭友团队：{}", fxBrandPersonVo + "服务员ID" + fxWaiterExtService.getWaiterIdList());
		IPage<FxBrandPersonVo> personVoIPage = fxBrandPersonService.getFanYouTeamListPage(page, fxBrandPersonVo);
		return R.ok(personVoIPage);
	}
}
